﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ch07
{
    //学生实体类
    class Student
    {
        //定义自动属性
        public int StuNo { get; set; }
        public string StuName { get; set; }
        public int StuAge { get; set; }
        public char StuSex { get; set; }
        //定义不带参的构造方法
        public Student() { }
        //定义带参的构造方法
        public Student(int stuNo,string stuName,int stuAge,char stuSex)
        {
            StuNo = stuNo;
            StuName = stuName;
            StuAge = stuAge;
            StuSex = stuSex;
        }
        //重写ToString方法
        public override string ToString()
        {
            return StuNo + "\t" + StuName + "\t" + StuAge + "\t" + StuSex;
        }
    }
}
